Bug fixes/ removed some code