Fixed bug 171; return the correct error code EPERS_MAXHANDLE instead -1