Fixed hidden layer off by one bug