Add more debug and fix a corner case