Revised debug annotations and const optimisation