id_param now returns nil when the param is nil
treat ActiveRecord::Relation as Array
Fix typo