Fix problems with arrays, generics and varargs