Performance tuning and issue #6