Fixed some issues thanks to magico13