#75: fix minor bug and add logging