Backport #14904 and #14929 to 2014.1

Backport #14904 and #14929 to 2014.1