Sub fixes

This PR fixes

http://trac.xbmc.org/ticket/14821
http://trac.xbmc.org/ticket/14864

This replaces: https://github.com/xbmc/xbmc/pull/4116