Fixing potential null reference exception (See https://fabtab.codeplex.com/workitem/10912)