Big fixes in previous commit