Fix some php 5.4 strict standards warnings, also tackle #51