Fix the get random type method.