 CONT: At the end when the camera pans the crew just before their  pardon, Scotty wears the rank pin of a Commander. This is despite  his being promoted to Captain in _Star Trek III: The Search for  Spock (1984)_, being listed in this films credits as "Captain  Montgomery Scott," and wearing Captains pins in the next film,  _Star Trek V: The Final Frontier (1989)_.