Add malformed check back for missing key