Corrected casting error in setAppSettings