fixed bugs found by Patrik and Miguel, typo on module creation and import