Fix various tests in order to make them compatible with C99. Part of the patches have been accepted upstream already, some are still being reviewed.