Fixed offset bugs due collision with walls