Bugfix & more tests