Add various edge case checks