fixed a bug in collection.php which broke stuff in PHP 5.3