Minor - fixing PHP warnings.
Minor - format code.
Minor - format code.
Fixes #6974 (change provided by aigualada)