fixed submitting of empty templates, added one more test, fixed error messages