use long math for long values
Merge branch 'cassandra-2.0' into trunk
make sure to close file streams