Fixed bug in compileDowncast