Added event on keydown that listens for the enter key. Also some other minor changes.