Fix complete_objects after XS port. Includes regression test. #1511