Fixes some things. Massive thanks to Michyprima for the help!