Using Math.log for compatiblity

Closes #246.