Update refs; several performance improvements.