Fixed some bugs in QLearning layers