Minor fixes for performance