fix js and php errors in query editor to allow saving queries, closes #219, wtf was that