Reverse previous changes to fix bugs