Fixed a few errors in feedforward function.