Adds tests and fixes a bug in RECORD type.