Fixes #1205. Fixes #1198. Other stuff.