Fixed a bug in data entry.
Added redirect to previous page on login and logout.