SQL & other thingy cleanup