Fix some of the robustness issues that arrose from #379