Bugfix: add offset after sum, not inside