Bunch of changes to get previous commit working.