added a wrapper function for list_deriv_vars that checks the return value...

and gives a decent error message.  Also fixed an issue where some slice expressions were falsely reporting that the slice was non-constant.