Fixed issue with using array key exists before checking if value is an array