There's an entire publication, IRS Pub. 519, that addresses your issues. It states that work in the U.S. while on a student visa will not be subject to social security and medicare taxes. At the point in time that your status changed then you were no longer performing work under a student visa and the rules change as of that time, not the end of the tax year.