Corrections of sending signals and optimizing the code.