Issue #41 code fixes