Fix crash with nil passes

Fix cases where a nil variable is passed to the titlecase method instead of a string.