 							}
 							if references.keys and references.keys.length > 0
 								references.keys.forEach (key) ->
-									if !(key in [null, undefined])
+									if key?
 										result.push({
 											caption: "\\#{commandName}{#{previousArgsCaption}#{key}#{closingBrace}"
 											value: "\\#{commandName}{#{previousArgs}#{key}#{closingBrace}"

		onChange: (change) ->
			cursorPosition = @editor.getCursorPosition()
			end = change.end
			context = Helpers.getContext(@editor, end)
			{lineUpToCursor, commandFragment} = context
			if lineUpToCursor.match(/.*%.*/)
				return
			lastCharIsBackslash = lineUpToCursor.slice(-1) == "\\"

			metadataManager = @metadataManager
			FilesCompleter =
				getCompletions: (editor, session, pos, prefix, callback) =>
					{commandFragment, closingBrace} = Helpers.getContext(editor, pos)
					if commandFragment
						match = commandFragment.match(/^\\(input|include){(\w*)/)
						if match
							[commandName, currentArg] = match
							result = []
							for file in Files.getTeXFiles()
								if file.id != @$scope.docId
