#1: bugfixes & cleanup