fixes from alexkurd