Fix issue where we would attempt to reference null objects