Bug fixes for flash