Minor performance fixes