merge in bug fixes from mainstream rapidsms repo