BUG: fix some divide by zero crashs