fixed a few crashes. Added ID stuff for testing
Merge branch 'master' into dialog