Fixes a little optimization bug