R service code is now throwing exceptions properly.
Code cleanup.