BUG: avoid devidision by zero

Change-Id: I6f1863c85826b7a2fc0c64518a558f75f6242680