Fixed a couple of little bugs and added some functions to help search through the database