fixes on some php incompatibility issues