Fixed borrowed-pointer discriminator implementation.
fixed typo bug