Fixed layer switching

Layer will be reseted to "default" if selected item of another ID or of another type,
but never if you switching the "rectangle", "line" or "flood fill" modes