Clean input stream before calling RS functions from UI

Resolves #33