Fixes issues #407.