Check if base == 1

Without this check, the code will infinitely loop and tie up the
server. It's actually pretty nasty.