bug fixes and improvement (integration testing)