Added some resiliency for bad xterm256 rgb codes.