Final changes (hopefully) and fixed open/new functionality.