Fixed the scrolling issue with the arrow keys
Extended the element visibility check
JSLinted the code and fixed a couple of warnings