[fix] few bugs for php 5.4