Fix #34: potential NPE while performing module deletion