Fixed array handling, simplified storing of parameters, more consistent use of byRef