Added missing definitions; cleanup; more consistency; etc.