Minor optimization (thanks ljeclanche!)