Various PHP errors are fixed