Fixed some gcc c99 issues