Update Issue 133

Add non regression test reproducing the issue.
Fixes Issue 269

(cherry picked from commit a52ee90242334c59ac911d62a7ae820201e93b4e)
Fixes Issue 246
Update Issue 245

Fix + non regression test
Update Issue 249

Fix + non regression test