Fixed usage of eregi
Converted some protected properties to public to allow direct read access
Added global ;, required by Moodle 2.4