Fix #654
Fix #634