Fixes for Issue #50, #55, and #61 (updated with refactoring of common code)