qtruby patch fixes

please review my changes. it compiles and installs - i didn't check if it actually works in all needed aspects.