Match code with v1.0.9b2 for Moodle 2.x