Fix #289.
Fix #291.
Fix #292.
Fix #293.
Fix #294.