Preliminary commit for issue #99 bugfix
Issue #99 bugfix cleanup upon suggestions from davec