Latest code from develop branch.

Fix remove playlist bug and code refactoring.