This stuff should no longer be necessary as loader should do it all.