this branch has #1413 and #1406