Fixed bugs with referenced modules and others