Replace old IsCommand func with cleaner version
Fix bug