more bug fixes; everything seems to work now