Fix compilation issues

 - Source now compiles with Roslyn
 - Fix all compiler warnings