Initial fixes
Runs with errors in node-webkit!