My mistake. The problem is not with the addition, but rather with my binary to BCD conversion routine that I'm using to output the number serially. I foolishly tested it only with 5-digit numbers, not smaller ones. It works great with the 5-digit number. Sorry about that.