Fix infinite loop, and add some more error handling
Fix infinite loop, and add some more error handling

uujava/mirah,aspleenic/mirah,uujava/mirah,mirah/mirah,felixvf/mirah,aspleenic/mirah,nuclearsandwich/mirah,felixvf/mirah,aspleenic/mirah,felixvf/mirah,uujava/mirah,felixvf/mirah,KeenS/mirah,mirah/mirah,aspleenic/mirah,mirah/mirah,mirah/mirah,nuclearsandwich/mirah,KeenS/mirah,KeenS/mirah,nuclearsandwich/mirah,uujava/mirah,KeenS/mirah,uujava/mirah,aspleenic/mirah