Some fixes to Array handling and added debug_log output.