Some small performance improvements
More fixes