code style; update build
resolves #189; merge with drount/master
resolves #187; move finish event to where it is garanteed fire
restore max peak in getPeaks