Fix a few problems with gem setup.