Fix on-start USE query, add tests