Fixed typo.
Cleaned up headers. Switched to gnu99 for lstat. Addition of checks for LARGEFILE64.