In my opinion you did everything just fine, but the problem was your fan... If you hear such a loud sound (or someone would switch the lights on or something like this) your body will always wake up...
Another thing is, that eventually you'll get used to that feeling. When I first experienced it I was scared as hell but now I kind of like it.