Be smarter about handling buffer file modes.