Fixing #1106, another small bug, and an unclear variable name.