Fix line endings and misc fix