Correct usage of array_key_exists. Fixes #16