fixing some demos

Looks likes some of the demo programs are broken. I'm fixing those as I come across.

(It might be a good idea to compile examples when a Cabal argument is used etc.)