Fixed Compilation Errors

UnaryFunction was renamed to Function. Fixed errors.