Some fix and performance updates.