Fixed a bug in setOffset()

test still needs to be updated