Bugfixes for offset