function cleanup
Merge branch 'master' into 1.0.2