Fixed Divide-by-Zero & Type Comparison

This plugin is exactly what I needed!

I had to make a couple of tiny changes for it to work for me.  Merge em if you like em.