Merged in fixes from 1.4.x branch