Fixes #862, Fixes #863