Fix code that doesn't work in php 5.4.