fixed some fugliness, mostly typos causing errors in tests
first test passes, second test fails with invalid key error