More tabbing and logic fixes