fix minor bugs of portal extracting.