Fixed two logic bugs in the last commit