fix potential problem with Records and List

Currently the code is using the parameter List or Record to instantiate the returned module and since no dependencies are provided, List or Record will be `undefined`. 

This construct is really confusing and I am not sure how reliable it is.