Fixes #270
Fixes #267. Fixes #266.