Some build fixes and line encoding changes