bugfixes: wrong class castings