MPD password fix and code cleanup