Changes invalid keys to a default value