templates: fixes,
ajax.php: fixes