Minor modifications for style and portability.