Added basic error reporting