Fix #434 and Fix #679

Fix #434 and Fix #679