more bugfixes, changed buy at peak behavior

more bugfixes, changed buy at peak behavior