Fix #248 - Calculate imports based on modules, not packages