Test and small cleanup for #247