Fixing gcm bugs