Cleanup and fixed logic issue