Fixes for #284 and #290

Decided to help you out and fix my own issues :) No problems with build with the const refs. <=VC9 fix is important for those compilers, other wont be impacted in any way.