Corrects gem flags