Fixed a major bug which prevented samples to properly run in release version.