Fix #1313
Tests for #1313