Done: fix various problems
TO DO: add tbl_R and run tests again