fix some bugs found with more testing, additional tests
more test coverage
Merge pull request #99 from JerrySievert/master

bug fixes and test coverage
temp fix for memory store ref
fix merge errors
more coverage and error handling