Fix some php warnings/errors