Various fixes

Sorry that it is just two big commits...

Changes released under the MIT license.
Possibly because I didn't use debug builds. Or maybe to do with the MonoDevelop Application Output. But I've changed it back.