Cleaned up linear approximator code.