Fix some listener code in the model