Updated some tests to testthat testing framework.