Assorted fixes

Merge fork with fixes from origin