Check array for commands rather than existence.

Fix for issue #51.