WIP: Fixes?

@rougier some of these changes might be useful, other ones probably not -- this is just a copy-paste from what I used for `vispy`. Feel free to open a PR on my PR to un-do some of them, or just comment on what's useful and what's not.