Cleaned up C code for RTB tools.