Added checks to prevent divide by zero errors.
Merge pull request #4 from davidlday/master

Added checks to prevent divide by zero errors.