Fix #499, #500