div by zero fix, couple other minors