minor bug fixes
now requires PHP 5.4.3+