Fixed some issues that came up in testing