A couple of fixes and addition of missing bits