Fix #413
Fix #336