fix for possibly invalid core calculation
Merge pull request #251 from lordgeorg/core-fix

fix for possibly invalid core calculation