cleanups
Merge branch 'master' of github.com:rosejn/torch-datasets
type function should check for sample == nil.