many bug fixes and hacks to get things working on ubuntu adequately...