Fixes for issues

See #1903 and #1902