Fix bug where wrong ext gets used