Recursively detect element type of an array.

Remove the quickfix of getPackage NPE with array types and recursively detect array element types.