Issue #1607: Code cleanup