Added handler and some minor fixes