Few fixes and improvments