doc & code fixes
Fixed constraints bug