Patch for handling module version tag on Moodle 2.6
Fixed a warning message showing up on Moodle 2.6
Fixed a bug introduced in the previous commit. It only happens in Moodle 2.6