Fix several disagreeing declarations/definitions.  Fix exception calls to be Linux-friendly.