Tweaked some stuff to take advantage of C99.