Fixed bad records problem in archiving that was causing a crash