Fixed some errors in the code and missing methods.