More tests + bugfix