A few changes to agree with strict PHP