Update for C99 + minor fixes