Code clean up and handling FIFO errors

unknown revision '8a18b0e52224'