bugfixes related to merge issues with adam's recent commits