Fixed bug in sort_by_date, optimized parse_blocks
Reformatted error messages