some small changes in the convenience functions, added real testing with py.test