Fixed an error where plotSpacesCount would increment indefinitely.