[BUGFIX] Add missing variable, ensure array as return value