Fixed couple of performance issues.