fixed unconsistently named dirty flag (shape dirty flags now all lowercase)
code cleanups