Fixed bug in moduleExtend