Please contact us if you have any trouble resetting your password.
Post the rest of the code. I have a strong feeling that you're doing all the initialization before you have a rendering context to operate on if you're getting that error all over the place.