Fixed issues in 5, 6, 7, 8, 9, 14

I'll submit these to the individual query files.