Fixed setting object variables from nested scope.

Closes #20.