Fix linux

Changes I had to make to make it at least start firefox.
Cherry-pick if you like, the commits can be applied in any order.