Merge pull request #16 from jamiepratt/master

a fix for Moodle 2.5 and fixing problem with validation error logic