cleanups & bugfixes