Correct problems with selection, use package name for code generation, and set the toolbar visible when appropriate