Some changes to support php 5.4
Merge pull request #366 from ekoisa/master

Some changes to handle php 5.4 warning message