Fixed bugs on this one.