Added basic error handling for expression evaluation