More style fixes

This change fixes some style issues and fixes some bugs with unplugging
controllers.