Fixed linking order and removed C99-specific code