Add a test case for an array ref bug
Fix the use of an undef value as an array ref