Fixed behavior of division by 0 on doubles (should be Infinity), added tests.