tests + minor bug