Modify $types so it is always an array