Handler code fixes