Fixed a potential null reference exception in completion.