Minor changes. Fixed the error messages so they work properly.