Fix potentials deadlocks (thx @takezoe) - close #147