monitor: Fix some bugs found during testing

Signed-off-by: Ondrej Kupka <ondra.cap@gmail.com>