minor typo for Q not set exception, imports reorganized