Fix bugs of amplify function.