Work with some cases where sqrtmod called with composite p