Merge "Fix some divide by zero errors that could crash the system." into jb-dev