Fixed bug in implementation of controller state equations.