Correct some compatibility issues with the offset operator and functions.

Could use a better refactor in the future.