fix obvious bugs ahead of serious testing