Add tests && small fix