Fixed placement of <?php separators, and miscellaneous other syntax problems.