a few changes to get tests to pass on php 5.3