Combine name type failure test. Correct name array handling. Move .has_key? call after .empty? call since it needs to be made any how.