Fix some minor bugs in widgets events