basic functionality tests and bugfixes