Resolve errors with tutorial code