Various bug fixes and tidy ups. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11757 a1c6a512-1295-4272-9138-f99709370657
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11727 a1c6a512-1295-4272-9138-f99709370657
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11721 a1c6a512-1295-4272-9138-f99709370657