SQL is finally working, also minor bugfixing