Fix infinite loop
Cleanup