Fixes relative paths, and removes unused components.