Fix status test and detect an infinite loop condition

Signed-off-by: Shea Levy <shea@shealevy.com>