Fixing bug with string keys