diff --git a/fiscalyear.py b/fiscalyear.py
index 661c703..d4a569f 100644
--- a/fiscalyear.py
+++ b/fiscalyear.py
@@ -530,7 +530,12 @@ class FiscalQuarter(object):
         if month < START_MONTH:
             year += 1
 
-        return FiscalDateTime(year, month, START_DAY, 0, 0, 0)
+        # Find the last day of the month
+        # If START_DAY is later, choose last day of month instead
+        max_day = calendar.monthrange(year, month)[1]
+        day = min(START_DAY, max_day)
+
+        return FiscalDateTime(year, month, day, 0, 0, 0)
 
     @property
     def end(self):

diff --git a/test_fiscalyear.py b/test_fiscalyear.py
index 2395737..f80953c 100644
--- a/test_fiscalyear.py
+++ b/test_fiscalyear.py
@@ -275,6 +275,35 @@ class TestFiscalCalendar:
             with fiscalyear.fiscal_calendar(start_month=2, start_day=29):
                 pass
 
+    def test_corner_cases(self):
+        # start_day does not exist in all months
+        with fiscalyear.fiscal_calendar(start_month=5, start_day=31):
+            # Non-leap year
+            assert fiscalyear.FiscalQuarter(2019, 1).start.day == 31
+            assert fiscalyear.FiscalQuarter(2019, 1).end.day == 30
+
+            assert fiscalyear.FiscalQuarter(2019, 2).start.day == 31
+            assert fiscalyear.FiscalQuarter(2019, 2).end.day == 29
+
+            assert fiscalyear.FiscalQuarter(2019, 3).start.day == 30
+            assert fiscalyear.FiscalQuarter(2019, 3).end.day == 27
+
+            assert fiscalyear.FiscalQuarter(2019, 4).start.day == 28
+            assert fiscalyear.FiscalQuarter(2019, 4).end.day == 30
+
+            # Leap year
+            assert fiscalyear.FiscalQuarter(2020, 1).start.day == 31
+            assert fiscalyear.FiscalQuarter(2020, 1).end.day == 30
+
+            assert fiscalyear.FiscalQuarter(2020, 2).start.day == 31
+            assert fiscalyear.FiscalQuarter(2020, 2).end.day == 29
+
+            assert fiscalyear.FiscalQuarter(2020, 3).start.day == 30
+            assert fiscalyear.FiscalQuarter(2020, 3).end.day == 28
+
+            assert fiscalyear.FiscalQuarter(2020, 4).start.day == 29
+            assert fiscalyear.FiscalQuarter(2020, 4).end.day == 30
+
 
 class TestFiscalYear:
 

FiscalCalendar starting on 31st day of the month throws ValueError
If the `FiscalCalendar` starts on the 31st of any month with 31 days, then `FiscalDate().quarter` throws a `ValueError`.

Example code:
```python
from fiscalyear import FiscalDate, FiscalYear, fiscal_calendar

with fiscal_calendar(start_month=12, start_day=31):
    fiscal_date = FiscalDate(2019, 10, 22)
    fiscal_date.quarter
```

Traceback:
```
Traceback (most recent call last):
  File "<input>", line 3, in <module>
  File "/site-packages/fiscalyear.py", line 594, in quarter
    if self in q:
  File "/site-packages/fiscalyear.py", line 413, in __contains__
    return self.start.date() <= item <= self.end.date()
  File "/site-packages/fiscalyear.py", line 493, in end
    next_start = self.next_quarter.start
  File "/site-packages/fiscalyear.py", line 485, in start
    return FiscalDateTime(year, month, START_DAY, 0, 0, 0)
ValueError: day is out of range for month
```

The quarters generated are:

* December 31st
* March 31st
* June 31st ← Not a valid day, so it breaks.

test_fiscalyear.py::TestFiscalCalendar::test_corner_cases test_fiscalyear.py::TestFiscalQuarter::test_current test_fiscalyear.py::TestFiscalQuarter::test_start test_fiscalyear.py::TestFiscalQuarter::test_end test_fiscalyear.py::TestFiscalQuarter::test_contains test_fiscalyear.py::TestFiscalDate::test_basic test_fiscalyear.py::TestFiscalDate::test_prev_fiscal_year test_fiscalyear.py::TestFiscalDate::test_next_fiscal_year test_fiscalyear.py::TestFiscalDate::test_prev_quarter test_fiscalyear.py::TestFiscalDate::test_next_quarter test_fiscalyear.py::TestFiscalDateTime::test_basic test_fiscalyear.py::TestFiscalDateTime::test_prev_fiscal_year test_fiscalyear.py::TestFiscalDateTime::test_next_fiscal_year test_fiscalyear.py::TestFiscalDateTime::test_prev_quarter test_fiscalyear.py::TestFiscalDateTime::test_next_quarter
test_fiscalyear.py::TestCheckInt::test_invalid_input[asdf-TypeError] test_fiscalyear.py::TestCheckInt::test_invalid_input[-999-TypeError] test_fiscalyear.py::TestCheckInt::test_invalid_input[0.0-TypeError] test_fiscalyear.py::TestCheckInt::test_invalid_input[value3-TypeError] test_fiscalyear.py::TestCheckInt::test_valid_input[1_0] test_fiscalyear.py::TestCheckInt::test_valid_input[2] test_fiscalyear.py::TestCheckInt::test_valid_input[0_0] test_fiscalyear.py::TestCheckInt::test_valid_input[-1] test_fiscalyear.py::TestCheckInt::test_valid_input[-2] test_fiscalyear.py::TestCheckInt::test_valid_input[1_1] test_fiscalyear.py::TestCheckInt::test_valid_input[0_1] test_fiscalyear.py::TestCheckInt::test_valid_input[999] test_fiscalyear.py::TestCheckYear::test_invalid_input[asdf-TypeError] test_fiscalyear.py::TestCheckYear::test_invalid_input[0.0-TypeError] test_fiscalyear.py::TestCheckYear::test_invalid_input[value2-TypeError] test_fiscalyear.py::TestCheckYear::test_invalid_input[-1-TypeError] test_fiscalyear.py::TestCheckYear::test_invalid_input[-1-ValueError] test_fiscalyear.py::TestCheckYear::test_invalid_input[0-ValueError0] test_fiscalyear.py::TestCheckYear::test_invalid_input[0-ValueError1] test_fiscalyear.py::TestCheckYear::test_invalid_input[10000-ValueError0] test_fiscalyear.py::TestCheckYear::test_invalid_input[10000-ValueError1] test_fiscalyear.py::TestCheckYear::test_valid_input[1_0] test_fiscalyear.py::TestCheckYear::test_valid_input[2] test_fiscalyear.py::TestCheckYear::test_valid_input[1_1] test_fiscalyear.py::TestCheckYear::test_valid_input[999] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-asdf-TypeError] test_fiscalyear.py::TestCheckDay::test_invalid_input[1--999-TypeError] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-0.0-TypeError] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-day3-TypeError] test_fiscalyear.py::TestCheckDay::test_invalid_input[1--1-ValueError] test_fiscalyear.py::TestCheckDay::test_invalid_input[1--1-TypeError] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-0-ValueError0] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-0-ValueError1] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-32-ValueError0] test_fiscalyear.py::TestCheckDay::test_invalid_input[1-32-ValueError1] test_fiscalyear.py::TestCheckDay::test_valid_input[1-1_0] test_fiscalyear.py::TestCheckDay::test_valid_input[1-2] test_fiscalyear.py::TestCheckDay::test_valid_input[1-1_1] test_fiscalyear.py::TestCheckDay::test_valid_input[1-31_0] test_fiscalyear.py::TestCheckDay::test_valid_input[1-31_1] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[asdf-TypeError] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[0.0-TypeError] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[value2-TypeError] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[-1-TypeError] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[-1-ValueError] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[0-ValueError0] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[0-ValueError1] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[5-ValueError0] test_fiscalyear.py::TestCheckQuarter::test_invalid_input[5-ValueError1] test_fiscalyear.py::TestCheckQuarter::test_valid_input[1_0] test_fiscalyear.py::TestCheckQuarter::test_valid_input[2] test_fiscalyear.py::TestCheckQuarter::test_valid_input[1_1] test_fiscalyear.py::TestCheckQuarter::test_valid_input[4] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments0-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments1-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments2-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments3-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments4-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments5-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments6-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments7-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments8-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments9-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments10-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments11-TypeError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments12-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments13-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_invalid_input[arguments14-ValueError] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_valid_input[arguments0] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_valid_input[arguments1] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_valid_input[arguments2] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_valid_input[arguments3] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_valid_input[arguments4] test_fiscalyear.py::TestValidateFiscalCalendarParams::test_valid_input[arguments5] test_fiscalyear.py::TestSetupFiscalCalendar::test_start_year test_fiscalyear.py::TestSetupFiscalCalendar::test_start_month test_fiscalyear.py::TestSetupFiscalCalendar::test_start_day test_fiscalyear.py::TestSetupFiscalCalendar::test_complex test_fiscalyear.py::TestFiscalCalendar::test_start_year test_fiscalyear.py::TestFiscalCalendar::test_start_month test_fiscalyear.py::TestFiscalCalendar::test_start_day test_fiscalyear.py::TestFiscalCalendar::test_complex test_fiscalyear.py::TestFiscalCalendar::test_nested test_fiscalyear.py::TestFiscalCalendar::test_wrong_type test_fiscalyear.py::TestFiscalCalendar::test_out_of_range test_fiscalyear.py::TestFiscalYear::test_basic test_fiscalyear.py::TestFiscalYear::test_current test_fiscalyear.py::TestFiscalYear::test_repr test_fiscalyear.py::TestFiscalYear::test_str test_fiscalyear.py::TestFiscalYear::test_from_string test_fiscalyear.py::TestFiscalYear::test_wrong_type test_fiscalyear.py::TestFiscalYear::test_out_of_range test_fiscalyear.py::TestFiscalYear::test_prev_fiscal_year test_fiscalyear.py::TestFiscalYear::test_next_fiscal_year test_fiscalyear.py::TestFiscalYear::test_start test_fiscalyear.py::TestFiscalYear::test_end test_fiscalyear.py::TestFiscalYear::test_q1 test_fiscalyear.py::TestFiscalYear::test_q2 test_fiscalyear.py::TestFiscalYear::test_q3 test_fiscalyear.py::TestFiscalYear::test_q4 test_fiscalyear.py::TestFiscalYear::test_contains test_fiscalyear.py::TestFiscalYear::test_less_than test_fiscalyear.py::TestFiscalYear::test_less_than_equals test_fiscalyear.py::TestFiscalYear::test_equals test_fiscalyear.py::TestFiscalYear::test_not_equals test_fiscalyear.py::TestFiscalYear::test_greater_than test_fiscalyear.py::TestFiscalYear::test_greater_than_equals test_fiscalyear.py::TestFiscalQuarter::test_basic test_fiscalyear.py::TestFiscalQuarter::test_repr test_fiscalyear.py::TestFiscalQuarter::test_str test_fiscalyear.py::TestFiscalQuarter::test_from_string test_fiscalyear.py::TestFiscalQuarter::test_wrong_type test_fiscalyear.py::TestFiscalQuarter::test_out_of_range test_fiscalyear.py::TestFiscalQuarter::test_prev_quarter test_fiscalyear.py::TestFiscalQuarter::test_next_quarter test_fiscalyear.py::TestFiscalQuarter::test_bad_start_year test_fiscalyear.py::TestFiscalQuarter::test_q1_start test_fiscalyear.py::TestFiscalQuarter::test_q1_end test_fiscalyear.py::TestFiscalQuarter::test_q2_start test_fiscalyear.py::TestFiscalQuarter::test_q2_end test_fiscalyear.py::TestFiscalQuarter::test_q3_start test_fiscalyear.py::TestFiscalQuarter::test_q3_end test_fiscalyear.py::TestFiscalQuarter::test_q4_start test_fiscalyear.py::TestFiscalQuarter::test_q4_end test_fiscalyear.py::TestFiscalQuarter::test_less_than test_fiscalyear.py::TestFiscalQuarter::test_less_than_equals test_fiscalyear.py::TestFiscalQuarter::test_equals test_fiscalyear.py::TestFiscalQuarter::test_not_equals test_fiscalyear.py::TestFiscalQuarter::test_greater_than test_fiscalyear.py::TestFiscalQuarter::test_greater_than_equals test_fiscalyear.py::TestFiscalDate::test_fiscal_year test_fiscalyear.py::TestFiscalDateTime::test_fiscal_year