Fix #472
Fix #541
Fix #544