Fixes scoping and space use.