Issue #544 - fixing bugs