added tests, removed compiler warnings