Some bug fixes and taking out old stuff