Fixed bug in while loop analysis, other small changes