Fixes caught by testthat