Bugfixes and a cleanup recipe