Fixed a minor bug that caused program to crash