Issue #388 - fixing bugs