Added tests for invalid keys