Fixed a bug where key errors could come up in first pass when pairs specified.