Fixed a volatile optimalisation and some other small things