bug fixes for c code