Fixed multiple bug on service provider as well as environment

Signed-off-by: crynobone <crynobone@gmail.com>