PHP5.4 warning fixes