Proper key generating
Tests update