handles complex types, arrays and lists correctly and fixed spelling errors