Major pull request

Check the commits I did for the bugfixes :)