Fixed type problems when transitioning from JSON to PHP