Replaced all BSD types with standard C99 types  (patch by Octavio Alvarez)