Fixed flat file storage.

Added a login listener.