fixed warnings and converted several asserts to debug messages