fix Cannon SIGFPE (bad input --> bad output)