Various fixes
Merge branch 'working'