Code clean up and handling FIFO errors

no such method: docs