Misc changes and cleanups, fixes hit testing of bitmaps