Ok, it wasn't the template that was the problem, rather the scripts/viewmessage.inc.php. I uploaded a stock copy of that and it's working now.