Correct naive checks to prevent array_key_exists warnings
Update comment