Merge from trunk... No it hasn't been far too long since I worked on this...!!!