Fixed bug with redirect after logging in for Moodle 2.4+.
Made some minor changes to the code to get rid of some warnings from
Eclipse validation.