Added form validation

Also fixed some saving errors