Fixes PHP errors on some PHP versions, see:
http://forum.cmsmadesimple.org/index.php/topic,9855.msg51492.html#msg51492