Changed Hash#index to Hash#key to remove some warnings
Fixed some unit tests