Made gray conversion to integer explicit.