More complete fix for bug 484 (includes fixes for records and tuples).