Fix dim-length inference in complete. Enhanced test_complete.