Web workers

Fix issues that broke web worker support.