Added close for GPIO and updated negative ifs