various fixes

Changed timer on runnable, handled cleanup better and fixed a typo in
the SQL