Fixed the functions added in the latest commit and added the type checking and the code generation for the arrays.