Fixes

Resolving merge conflicts and tidying up.