added some error checking for the frame length

Added error checking for the frame length on the cmd word decode so that
the program will not crash, and instead will return 1 (error condition).