Fixed #2318 and #2322.
Backend SHA: d77cb1a474cf86978f02ce125c18d24c97f55049