Minor logic bug in last commit