Fixed some tests

code cleanup

Added inventory tests