Fixed Hub bug and started writing tests