fixing some undefined errors

I have fixed some undefined errors. Probably I learn how to create pull request.