Various updates for better portability.