Make sure rd is initialized. Fixes #1646