Initial fix for #251 (will improve for 2.3)