Fix inverted logic.
Add php 5.3 compatibility fix.
Make getSingleton() public to be PHP 5.3 compatible again.
Merge branch 'master' into develop