Fix getting aftertype properly