Fix bug that resulted in duplicate tasks
Improve pkg-config file generation