Fix a bug with empty / non-existent package.* files
Implement integration tests