several cal bug fix