Sync master and dev

Seems like we never merged these to master.

PR to master for #267.
PR to master for #262.