Fixed errors - killed dynamic_cast