Fixing routine that got into wrong branch