MDL-41889 tool_generator: Fixing problem detecting the last used course shortname