* Fixes from PR 367 upstream