Fix 1114 and 337

- Fix #1114
- Fix #337