Misc small fixes
Merged with master