Fixed a rounding error in the vector class, which was caused by casting to
an int before returning as a float. Also tidied the vector class a bit.