Fixes for C89 limitations and some const types