Improved the implementation of the demo mode.