Fixing 'gem' detection