Fixes #55 and #50

I think this fixes some oddities with both issues