minor performance fixes