Fixing invalid rank