Merged #264 and upstream/develop.

resolves #264