Re-arranged build file elements order.
This fixes some issues with things being called before they are set.