Small optimisations
Fixed performance issues and minor concurrency problems