Fix Issue #934

Fixes issue #934. Command is created for the selected database, not the default database.
Merge pull request #935 from aarondfrancis/master

Fix Issue #934