Corrected code so that error messages show in proper location and error messages are passed to views properly.