Fixed some bugs elucidated by trying out block sizes different to 512
bytes