Add -g to compile flags
Fix typo in loop range definition; change the recursiveSetNormalisation call to act on 'eff' not 'this'; use nResB as shorthand
Put integral calculation inside a try-catch block to try and make errors more informative