bug fixes and adjustments