Fixes #137 and fixes #143.