Fix bug in PBC