Some fixes in the handler.