Fixes #271 and #272