Fixed final bugs.