Fixed some issues that caused nulls.