Fixed errors in implicit scoping