404 template and other fixes