fixes based on @panuhorsmalahti feedback on PR#6