fixed tests
added code coverage to travis
fixed some bugs and code problems