Tests now run correctly, and fixed a flow control issue
Blank lines for readability