I think this fixes #185 and #184