A lot of changes/fixes