Various bug fixes and changes as discussed in email.
Merge branch 'master' of https://github.com/charmeproject/charme_plugin