Fixed some ugly if statements and tabbing.