Fixed populate tables order to work with FK