Fix #401
Fix #499