Fix #551 resize problem