Sorted out dependencies and broken references