Final tests and fixes