Use isset() instead of array_key_exists(). Closes #3364

Thanks to @aswinlutchanah for the hint.