Fix once and for all the annoying issues with handling arrays...

Signed-off-by: Suki <suki@missallsunday.com>