Bug fixes

Fixed bugs where you could press a submit button without selecting any
options and the action would fail. Also fixed a bug where the code
would fail trying to email because I had already deleted the entities.