When the files are unpacked tmsdefine.inc and tmsdefine10.inc are in 3 places: the target folder, common and source folders. I renamed the first instance and copied it to the other locations, but still got the same errors.
I had to remove the Query Studio package from my development environment, completely. After that everything worked as it was supposed to. I am currently not using that product, but installed it as part of my subscription.
Thanks!