\#86: fixed js loop when no prefixes are defined
#89: fixed infinite loop. should improve speed query editing speed quite a bit