fixed array.length conditionals; prevent array cleanup from hitting unsuspecting conditionals by accident