Tidy-up + bug-fixing