Fix issue with break inside while in def called from block