Various fixes

Final commit!