Simplified some functions to match interface to R better.