Minor Bugfixes

Some minor bugfixes needed for the addition of the Script Editor in the
previous commit.