More perf. improvements and fixes in ClassScanner