Fixed a small bug that would crash the program