Fix PHP Error in error message generation