Fix some nil exceptions