Fix issues detected by AddressSanitizer and UndefinedBehaviourSanitizer
See branch sam/ci-sanitize. Currently this turns up some errors!
Corresponding tracker core issue: tracker#10
Edited by Sam Thursfield
See branch sam/ci-sanitize. Currently this turns up some errors!
Corresponding tracker core issue: tracker#10