Bug fixes for modelsim