tests! and bugfixes