Fixed bugs in keepaway task and generic agent