Fixed a bug in the php wrapper