tests and bugfixes
tests and bugfixes