RP-132 Fix overflow

Given that those calls are all/mostly at the tops of the relevant functions, and the functions are all only called from a single place, it may make sense to just move them up to the caller. See: http://en.wikipedia.org/wiki/Dependency_injection