Fixed typo in offset function