This bug usually happens at random, either during a really big sprite-building or a certain time passed.
Like the title, the cursor automatically erases pixels I placed when I never really want to. It also affects lower layers. The only solution I found to avoid this is to hold the left-click down in a Draw state.
Right click on a pencil tool now affects only the current slice. If you want to go deeper use [E]raser tool and select deep option.