Hopefully some fixes for #39