Fix PHP Warning: "Illegal offset type..." and fix IDE warnings.