Issue #231 code fixes