based on pr #186 and fix issue #180
Merge branch 'fix-180-again' into epoch