Gem-related fixes.