Code clean up and handling FIFO errors

Revision:
69:4305ac772a66
Parent:
63:2655a04c00f5