Fix for ResourcePackage

implemented fix for ```ResourcePackage``` wrt key generation. When ```-``` was present in name, an endless loop might have occurred during inflating. Added a test case.