Test fixes and associated bugs for correct behavior.