Compiled fix from 533cdc4b3b2eab04a724a1ceffac6926c6d7e057