fixed minor bugs, fixed bitmap leak, minor interface change