Script: Add better command handling