Make sure that everthing is a string. For some reason when I changed the data type from date to string, my Web form worked. It still have a problem with parsing the date string to date. Before publishing you might want to click on the "Design checker to see if you have any errors.
I have had to take a function and do one line, publish, upload the template and then open the form to see if you do not get the 5337 error.
Mike