python linking fixes

This should improve the situation for bug #88 for most people, I think.

So other unrelated minor changes included here as well