initialize at first use, rather than setting, also fix tests