Some small improvments and fixes