Support for gingerbread. Misc improvements