Port fix from wordpress to this