some changes with the aim to fix problems reported on #89