Small efficiency tweak to HasModule<T>