Added test scene and some improvements for safety.