Hopefully fixed logic.