Couple improvements imported from monitor-core