[BUGFIX] Fixes php errors showing up because of empty variables used for foreach