Fixed segfault on named type array declaration, as well as many random bugs