You are nonresident for 2007 and 2008.
For 2007, you need to file amended tax return Form 1040X alongwith properly done Form 1040NR or 1040NR-EZ and Form 8843.
On Form 1040X Column A is what was on the original return, Column C is what should have been there (that is corrected amounts) and Column B is the difference. Complete these columns and then refigure your tax. Read about F1/H1-B tax filing:
Your U.S. Tax Return: The U.S. Visas