Fixed crashes for edge cases with nil/null