Minor fixes

Minor fixes that prevent the app from crashing.