flash fixes for #177, #199, #265