fixed a bunch of compiler warnings
corrected scale on time buckets to nanoseconds
master merge