Quick fix to prevent crashing on bad blocks. Will have to investigate