Fixed if loop for port + brew check