A lot of these casts will not be needed anymore.
They were added to quell ambiguity errors between boost::int64_t and system int64_t.