fix requirejs and primus problems + various.