fix gain sign bug.