Fix inconsistent line endings and add missing xml comments