Tidying up tests. Adding fixes for use from another package.