Bug fixes for forever-loop compilation