remove overshooting of the cached bitmap mask size
fixed lots of bugs