Fixed compatibility with php 5.3 [closes #28]