Bug - using erase causes secondary color to be applied

I’ve assigned right-click to use eraser (default being fill). The bug happens when using shift-RMB to ‘erase a line’. Quite Strangely, every alternate click applies the secondary color (the one you swap to by hitting ‘x’). For example the first click erases as expected, the second click draws a line, the third click again erases etc.