add custom size error support and tests, ref #20