Improved efficiency.

Fixed output in demo application.
MonoDevelop/Xamarin compatibility.