Fixed coding style and removed C99 function.