Fixed some PHP Warning bugs