Fixed an issue with php 5.3 in tests and code style improvements