Fixed a bug in the ghost pen release counting logic