Cherry picked commits over to 0.6

A couple of the last commits I would say do not break anything APIs and hence should be included as part of the 0.6 version of the module. This PR is simply to get someone other than myself to ok this and merge.