fixed various issues - issue #142