OSX: Added loop segments to wave form overlay.

- Fixed bug in database script.