fixes some bugs in create_modules where modules weren't getting written correctly and __init__ files were being overwritten