fixed bug on Method constructor and added tests