unittest and small fix