This possibly fixes #11, but I'm not confident yet.