Sequence type detection refactoring.
Refactor IOError catches, fix logic error in sequence type detection.