Corrected a bug: subscript out of range if textid and pracid are zero