Added more tests and fixed some small issues with ha monitoring