Fix type of underlying integer to work with allocators. Fix convert_to routines to handle very large bit counts.