Various coding warning improvements from phpstorm