Fixed array mapping for row numbers.
Added logout link to user menu.