Fixed error checking in mboxlib.c