Fixed shift duration calculation

Fixes issue #136
Merge pull request #157 from robofish/shiftDurationFix

Fixed shift duration calculation