tests + fixes