Fix bug in runtime main script