Fixed certain functions, added others.