Add some parameter checks
Merge branch 'PHP-5.5'