Fixed some offset bugs