Fix issues when running by category

@ikeough @sharadkjaiswal 

The submission removes some redundant code to make running by category successfully.