bug fixes; improvements