Fix Remove action on topLevelFile.

Fixes #2347, #2384 
@ussuri