Fixed the logging (although now not consistent stock) but lots of things fixed