Fix NPE bug when using deprecated modules= query arg