Fixed and refactored xbmc scripts