Fix annoying exception
Small unit test fixes