Fix C# output formatting

Plus some code formatting, fixes #19