Fixes #71 - some crazy races inside erasure and simplify the code

- This change also brings in changing 'unsigned char' to 'uint8_t'
for brevity