various fixes, nil checks, unglued is evil