Fix Module.php

Also add tests