Fix a couple of fatal exceptions caused by bad input
Merge pull request #767 from Suirtimed/tb/simple-calc

Fix fatal exceptions in samples/simple-calc.rb

Couldn't handle bad input

Changelog: bugfix