Some changes and fixes