Add verification for names to be a list, fix #4265