Fix bugs in pinry init