fixed 2 bugs based on HUnit test, test still fails