Fixed null reference exception.