Fixed bugs, added methods.