Fixes redundant basename calls in service.sh