Fixed up some old security code. Cleaned up flash messages.