Fixed potential arithmetic exception due to rounding, and set up maven to build an executable jar.