Fix some bugs. C