Fixed bug in Template::valid_post