Added support for (and fixed compiler issues associated with) 64-bit builds.