minor stuff and PHP 5.2 compat