fix issues noticed by Alexander