Better tests and fixed convenience functions.