Important fixes and performance optimizations!