Resolved bug with pinCount becoming negative