Code cleanup, using true and false instead of 1 and 0 for variable checks