Added test case for KCanvas and fixed errors.