Adjusted sequence of input parameters of various funcs. Fixed returned values of manipulation funcs.