Bug fixes for a specific set of situations in the demo file.