Efficiency tweaks and clearing a PHP notice