Hopefully last changes for merging
Finished merging, still needs testing