remote.c: turn some error() or die() to BUG()