Added sanity checks in commands