Avoir leading undefined rect
Various bugfix