updated perrors and added tests