Fix #4089 - undefined method `downcase' for nil:NilClass
Land #4151, downcase nil deref. fix