Make error more clear for invalid module factories