Fixed the two major bugs that were causing crashes for the application.