more code tests + fixes