Issue #187 - fixing bugs