Script: Better command handling