minor fixes and 2D demo