Fixing an offset bug