More tests + fixes