Added query 9 and minor fixes