Bugfix introduced on merge master (includes #45) into #234