Early exit & other performance improvements.