Issue #128 - fix bugs