Smarter peak picking. Fixed type error.