Fixed some bugs in the learning agent and feature extractor