Fix one shadow bug, add shadow debug mode.

There are still other shadow bugs to fix.