adding more tests for 'inside code block' filtering and fixing out of bounds exception