More tests + some bugfix