Bug fixes for Test Mode