Fix scope naming and add a bit more documentation.