fixed several bugs in the backend and added some more polyglot support