Fixed a lot things
fixed merge errors