Bugfix/tests