Bugfixes in extension.js