Add missing array key checks

Fixes #423