bug fixes and delay adjustment