Bugfixes:
- Initialize n_opt with n, is not used but called before being set by calc_save_factor
- Do not optimize (-Og) in DEBUG, seems to break compilation in some cases.