PR #269 attempted to fix this, but we had to revert the change (14c778e) because it caused other more serious problems (see #285). At some point an implementation that doesn't break everything would be great!