Several fixes and hacks to allow correct table creations