More tests + bug fix