Small commit
Safety commit

Worked a lot on more error checking on when to insert things into a
database, saving piDee and things of that nature.

Does not work right now.