Fix array types and multiple returns