Replaces strtol() calls with str2uchar() ones and adds error messages, where neccessary, if invalid input is given.