added integration test in python, changed error messages slightly for conformity