various fixes (like undefined offsets)