Added single-read support but did it quickly and badly, needs refactoring. Also bugfixes
Bugfixes