Fixed wrong behavior of pertag