Merge pull request #22 from geekwright/master

Some database related fixes from redheadedrod