Work from home part of the year

I have two questions: 

 

First question- 

I'm asking if my understanding of the tax I'm paying is correct: 

I recently graduated in TN and planning to start a new position by the end of August for a company based in CA. Due to work from home, I'm planning to move to CA mid-December. 

 

If I separate my income as January - August (1), August - mid-December(2) and mid-December till end of December (3).

 

I will be filing:

1. TN resident state tax return - (1), (2) and (3)

2. CA resident state tax return -(3)

 

Since (2) is not a California source income (WFH from TN) so as a nonresident from August - mid-December, I shouldn't have to file. 

TN doesn't have income tax, so theoretically, I only need to pay state income tax for (3)?

 

The second question-

If the HR withheld CA tax for (2) accidentally, do I file nonresident tax return for CA and stated income as 0 for that period to get the withheld tax back?