fixes for #249 and #247