Add FakePir class and fix bug in Pir