Bunch of changes to make stuff work