Fixed bugs from clean up.