important bug fix and minor code restyling
unnecessary condition here
renamed variable to avoid confusion
re-enabled brute-force test cases