Minor bugfixes. Also added a few more things needed for OpenAccessory