minor design fixes, other bug fixes