Fixed a bug in requireDir module