Another try at issue #61 and #62 - an earlier fix was partially working but the issue persisted - this extends it a bit.