Backports of Bugs

Backports of some fixes to bugs made in develop