workaround for issue with NSKnownKeysDictionary2

fixes #33 and #39

as suggested in http://hipbyte.myjetbrains.com/youtrack/issue/RM-523 , credit to @Watson1978