Fixes to the PIF
Added a flushDatabase method
Merge branch 'testflight'