patch from Guy to be able to build debug version