Fixes PHP crash due to typo error in certain cases