runtime: fix ctrlport issues and add some Python QA